// 抽象类是事物的抽象，通常用来捕捉子类的通用特性，抽象类只能被单一继承并且可以有实现体
abstract class Animal {
    abstract runIng(): void
}

class Dog extends Animal {
    public name: string
    public age: number

    constructor(name: string, age: number) {
        super()
        this.name = name
        this.age = age
    }

    public runIng() {
        console.log("跑步")
    }
}

const res: Dog = new Dog("陶品奇", 22)
console.log(res)
res.runIng()

// 接口是一种行为的描述，接口只能有函数声明
interface InterfaceAnimal {
    name: string
    age: number
    address: string
    getHai: () => void
}

class TheCat implements InterfaceAnimal {
    public name: string
    public age: number
    public address: string

    constructor(name: string, age: number, address: string) {
        this.name = name
        this.age = age
        this.address = address
    }

    getHai(): void {
        console.log("您好")
    }
}

const t: TheCat = new TheCat("猫猫", 22, "衡阳")
console.log(t)